using Chaotic.DataBase.DataAccess;
using Chaotic.DataBase.DBAccessLibrary.Model;

namespace Chaotic.DataBase.DBAccessLibrary.Common;

public static class DbTypeConvert
{
	public static string GetType(DatabaseType fromtype, DatabaseType totype, string type, string length)
	{
		string result = type;
		int.TryParse(length, out var result2);
		type = type.ToUpper();
		switch (fromtype)
		{
		case DatabaseType.DB2:
			if (type == "NUMBER")
			{
				result = ((result2 > 9) ? "DECIMAL" : "INTEGER");
			}
			break;
		}
		return result;
	}
}
